package com.tiny.mirror.service.product.infrastructure.entity.db;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tiny.mirror.basic.db.mybatis.entity.AuditedEntity;
import com.tiny.mirror.basic.db.mybatis.handler.JacksonTypeHandler;
import com.tiny.mirror.service.product.domain.ability.AbilityParams;
import com.tiny.mirror.service.product.enums.AbilityStatusEnum;
import com.tiny.mirror.service.product.enums.AbilityTypeEnum;
import lombok.Getter;
import lombok.Setter;
import org.apache.ibatis.type.JdbcType;

@Getter
@Setter
@TableName(value = "ability", autoResultMap = true)
public class AbilityEntity extends AuditedEntity<Long> {

  @TableId(value = "id", type = IdType.AUTO)
  private Long id;
  @TableField(value = "name")
  private String name;
  @TableField(value = "params", jdbcType = JdbcType.VARCHAR, typeHandler = JacksonTypeHandler.class)
  private AbilityParams params;
  @TableField(value = "type")
  private AbilityTypeEnum type;
  @TableField(value = "status")
  private AbilityStatusEnum status;
  @TableField(value = "order_num")
  private Integer orderNum;
}
